package io.keen.client.java.http;

public final class Response {
    public final String body;
    public final int statusCode;

    public Response(int statusCode, String body) {
        this.statusCode = statusCode;
        this.body = body;
    }

    public boolean isSuccess() {
        return isSuccessCode(this.statusCode);
    }

    private static boolean isSuccessCode(int statusCode) {
        return statusCode / 100 == 2;
    }
}
